<form {if isset($class_for_editing)}id="edit_class_{rand()}" onsubmit="return edit_class(this.id);" class="class_edit" {else} id="new_class_{rand()}" onsubmit="return save_class(this.id);"{/if}>
    {if isset($class_for_editing)}
        <input type="hidden" name="class_id" value="{$class_for_editing->get_id()}"/><br/>
    {else}
        <input type="hidden" name="course_id" value="{$course_id}"/><br/>
    {/if}
    <label for="class_teacher">{__ t = "Professor"}</label>
    <input type="text" id="class_teacher" name="class_teacher" {if isset($class_for_editing)}value="{$class_for_editing->get_teacher()}"{/if}/><br/>
    <label for="class_identification" >{__ t = "Identificaçao"}</label>
    <input type="text" id="class_identification" name="class_identification" {if isset($class_for_editing)}value="{$class_for_editing->get_identification()}"{/if}/><br/>
    <label for="class_priority">{__ t = "Prioridade"}</label>
    <select name="class_priority">
            <option value="1" {if isset($class_for_editing) && intval($class_for_editing->get_priority())==1}selected="selected"{/if}>1 (Baixa)</option>
            <option value="2" {if isset($class_for_editing) && intval($class_for_editing->get_priority())==2}selected="selected"{/if}>2 </option>
            <option value="3" {if !isset($class_for_editing) || (isset($class_for_editing) && intval($class_for_editing->get_priority())==3)}selected="selected"{/if}>3 (Média)</option>
            <option value="4" {if isset($class_for_editing) && intval($class_for_editing->get_priority())==4}selected="selected"{/if}>4 </option >
            <option value="5" {if isset($class_for_editing) && intval($class_for_editing->get_priority())==5}selected="selected"{/if}>5 (Alta)</option>
    </select><br/>

    <div id="class_hours" >
        <label for="number_of_days">{__ t = "Número de aulas"}:</label>
        <select id="number_of_days{rand()}" name="number_of_days" onchange="add_hours(this.id)">
            <option value="1" {if isset($class_for_editing) && sizeof($class_for_editing->get_times())==1}selected="selected"{/if}>1</option>
            <option value="2" {if isset($class_for_editing) && sizeof($class_for_editing->get_times())==2}selected="selected"{/if}>2</option>
            <option value="3" {if isset($class_for_editing) && sizeof($class_for_editing->get_times())==3}selected="selected"{/if}>3</option>
            <option value="4" {if isset($class_for_editing) && sizeof($class_for_editing->get_times())==4}selected="selected"{/if}>4</option>
            <option value="5" {if isset($class_for_editing) && sizeof($class_for_editing->get_times())==5}selected="selected"{/if}>5</option>
        </select>
        <div class="class_hours" >
           {if isset($class_for_editing)}
               {foreach $class_for_editing->get_times(false) as $key=>$class_time}
                   {Smarty_View::factory("2_insert_data/insert_data_class_time.tpl")
                    ->set("class_time",$class_time)
                    ->set("class_time_index",$key)
                    ->render()}
               {/foreach}
           {else}
               {Smarty_View::factory("2_insert_data/insert_data_class_time.tpl")->render()}
           {/if}
        </div>
    </div>

    <input class='add_class_button' type="submit" value="Salvar" />
    {if isset($class_for_editing)}<div id="cancel_class_edit{rand()}" onclick="cancel_class_edit(this.id)">Cancelar</button>{/if}
    <br/>
</form>
